Make icon data caching work again. (#168851, Alexander Larsson)
authorMatthias Clasen <mclasen@redhat.com>
Tue, 1 Mar 2005 14:59:04 +0000 (14:59 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 1 Mar 2005 14:59:04 +0000 (14:59 +0000)
2005-03-01  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkicontheme.c (theme_lookup_icon): Make
icon data caching work again.  (#168851, Alexander Larsson)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkicontheme.c

index e8e6149b6dd6992c8882c9304d30d030121b531b..0517ec73478f89ce862f1bf266e357938e86aea0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-03-01  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkicontheme.c (theme_lookup_icon): Make 
+       icon data caching work again.  (#168851, Alexander Larsson)
+
        * gdk-pixbuf/gdk-pixbuf.c:
        * gdk-pixbuf/gdk-pixbuf-features.h.in:
        Revert the previous change, since it breaks
index e8e6149b6dd6992c8882c9304d30d030121b531b..0517ec73478f89ce862f1bf266e357938e86aea0 100644 (file)
@@ -1,5 +1,8 @@
 2005-03-01  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkicontheme.c (theme_lookup_icon): Make 
+       icon data caching work again.  (#168851, Alexander Larsson)
+
        * gdk-pixbuf/gdk-pixbuf.c:
        * gdk-pixbuf/gdk-pixbuf-features.h.in:
        Revert the previous change, since it breaks
index e8e6149b6dd6992c8882c9304d30d030121b531b..0517ec73478f89ce862f1bf266e357938e86aea0 100644 (file)
@@ -1,5 +1,8 @@
 2005-03-01  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkicontheme.c (theme_lookup_icon): Make 
+       icon data caching work again.  (#168851, Alexander Larsson)
+
        * gdk-pixbuf/gdk-pixbuf.c:
        * gdk-pixbuf/gdk-pixbuf-features.h.in:
        Revert the previous change, since it breaks
index 77b6c8c7c0eb7ecba99187364c9fceace3d25751..33208fc5856892ce08d508271f4b745d41727439 100644 (file)
@@ -1897,7 +1897,12 @@ theme_lookup_icon (IconTheme          *theme,
       icon_info->cp_filename = g_locale_from_utf8 (icon_info->filename,
                                                   -1, NULL, NULL, NULL);
 #endif
-      if (min_dir->cache && has_icon_file)
+      
+      if (min_dir->icon_data != NULL)
+       icon_info->data = g_hash_table_lookup (min_dir->icon_data, icon_name);
+      
+      if (icon_info->data == NULL &&
+         min_dir->cache && has_icon_file)
        {
          gchar *icon_file_name, *icon_file_path;
 
@@ -1910,13 +1915,12 @@ theme_lookup_icon (IconTheme          *theme,
                min_dir->icon_data = g_hash_table_new_full (g_str_hash, g_str_equal,
                                                            g_free, (GDestroyNotify)icon_data_free);
              load_icon_data (min_dir, icon_file_path, icon_file_name);
+             
+             icon_info->data = g_hash_table_lookup (min_dir->icon_data, icon_name);
            }
          g_free (icon_file_name);
          g_free (icon_file_path);
        }
-      
-      if (min_dir->icon_data != NULL)
-       icon_info->data = g_hash_table_lookup (min_dir->icon_data, icon_name);
 
       icon_info->dir_type = min_dir->type;
       icon_info->dir_size = min_dir->size;